<template>
  <div class="el-image">
    <img style="z-index: 1" :src="src" alt="图片" @load="handleLoad" @error="handleError">
    <div class="sal textvalue">
      <span>3500x3400</span>
    </div>

    <div class="sal download">
      <span>下载</span>
    </div>

    <div class="loveMark" @click="collect">
      <span v-if="true" class="iconfont icon-xiai"></span>
      <span v-else class="iconfont icon-aixin"></span>
    </div>

  </div>
</template>

<script>
export default {
  name: 'yanyun-Image',
  props: {
    src: String
  },
  methods: {
    collect(){

    },
    handleLoad(event) {
      // 处理图片加载成功的逻辑
      this.$emit('load', event);
    },
    handleError(event) {
      // 处理图片加载失败的逻辑
      this.$emit('error', event);
    }
  }
}
</script>

<style scoped>
.el-image {
  display: inline-block;
  position: relative;
}

.el-image img {
  display: block;
  width: 100%;
  height: 100%;
  Object-fit: fill;
}

.sal{
  position: absolute;
  z-index: 999;
  color: white;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  line-height: 20px;
  text-align: center;
}

.textvalue{
  top: 5px;
  left: 5px;
  width: 95px;
  height: 20px;
}

.download{
  top: 5px;
  right: 5px;
  font-size: 12px;
  width: 50px;
  height: 20px;
}

.loveMark{
  bottom: 5px;
  right: 5px;
  position: absolute;
  z-index: 999;
  color: white;
  background-color: rgba(0, 0, 0, 0);
}

.center-list{
  font-size: 20px;
}

.icon-aixin{
  color: red;
}
</style>
